package com.entity;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * AccpStudent entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "ACCP_STUDENT", schema = "ACCP")
public class AccpStudent implements java.io.Serializable {

	// Fields

	private Integer id;
	private AccpClass accpClass;
	private AccpRole accpRole;
	private AccpUser accpUser;
	private Integer groupid;
	private Integer sstatus;
	private String nickname;
	private Set<AccpVote> accpVotes = new HashSet<AccpVote>(0);

	// Constructors

	/** default constructor */
	public AccpStudent() {
	}

	/** minimal constructor */
	public AccpStudent(Integer id) {
		this.id = id;
	}

	/** full constructor */
	public AccpStudent(Integer id, AccpClass accpClass, AccpRole accpRole,
			AccpUser accpUser, Integer groupid, Integer sstatus,
			String nickname, Set<AccpVote> accpVotes) {
		this.id = id;
		this.accpClass = accpClass;
		this.accpRole = accpRole;
		this.accpUser = accpUser;
		this.groupid = groupid;
		this.sstatus = sstatus;
		this.nickname = nickname;
		this.accpVotes = accpVotes;
	}

	// Property accessors
	@Id
	@Column(name = "ID", unique = true, nullable = false, precision = 8, scale = 0)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CID")
	public AccpClass getAccpClass() {
		return this.accpClass;
	}

	public void setAccpClass(AccpClass accpClass) {
		this.accpClass = accpClass;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "RID")
	public AccpRole getAccpRole() {
		return this.accpRole;
	}

	public void setAccpRole(AccpRole accpRole) {
		this.accpRole = accpRole;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "USERID")
	public AccpUser getAccpUser() {
		return this.accpUser;
	}

	public void setAccpUser(AccpUser accpUser) {
		this.accpUser = accpUser;
	}

	@Column(name = "GROUPID", precision = 8, scale = 0)
	public Integer getGroupid() {
		return this.groupid;
	}

	public void setGroupid(Integer groupid) {
		this.groupid = groupid;
	}

	@Column(name = "SSTATUS", precision = 8, scale = 0)
	public Integer getSstatus() {
		return this.sstatus;
	}

	public void setSstatus(Integer sstatus) {
		this.sstatus = sstatus;
	}

	@Column(name = "NICKNAME")
	public String getNickname() {
		return this.nickname;
	}

	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "accpStudent")
	public Set<AccpVote> getAccpVotes() {
		return this.accpVotes;
	}

	public void setAccpVotes(Set<AccpVote> accpVotes) {
		this.accpVotes = accpVotes;
	}

}